package com.blood.modules.common.controller;

import com.blood.core.annotation.JwtIgnore;
import com.blood.core.enums.PlatformTypeEnum;
import com.blood.core.resp.GlobalResultStatus;
import com.blood.core.resp.ResponseResult;
import com.blood.modules.common.dto.resp.WorkResp;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author daoren
 */
@Api(value = "公用参数文档", tags = "公用参数文档")
@RestController
@ApiSort(0)
@RequestMapping("/common/work")
public class SysWorkController {

    /**
     * 公用参数说明
     *
     * @return 参数信息
     */
    @ApiOperation(value = "公用参数说明")
    @GetMapping(value = "/query")
    @JwtIgnore
    public ResponseResult<WorkResp> query() {
        WorkResp workResp = new WorkResp();
        workResp.setToken("登录凭证");
        for (PlatformTypeEnum platformTypeEnum : PlatformTypeEnum.getList()) {
            workResp.getPlatform().put(platformTypeEnum.name(), platformTypeEnum.getValue());
        }
        return GlobalResultStatus.SUCCESS.toResult().response(workResp);
    }

}
